﻿package mortal.game.view.common.guide.stepOperater
{
    import Message.DB.Tables.*;
    import com.gengine.global.*;
    import com.greensock.*;
    import com.mui.controls.*;
    import mortal.component.window.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.guide.data.*;
    import mortal.game.view.common.guide.view.*;
    import mortal.mvc.core.*;

    public class AutoGuideNewFuncSteper extends AutoGuideStepBase implements IAutoGuideSteper
    {
        private var _view:AutoGuideNewFunc;

        public function AutoGuideNewFuncSteper()
        {
            return;
        }// end function

        public function guide(param1:AutoGuideData, param2:Window = null) : void
        {
            _data = param1;
            if (this._view == null)
            {
                this._view = new AutoGuideNewFunc();
            }
            this._view.show();
            var _loc_4:Number = 0.1;
            this._view.scaleY = 0.1;
            this._view.scaleX = _loc_4;
            var _loc_3:* = FuncPreCofonfig.instance.getConfigBySystem(param1.guideTypeValue);
            if (_loc_3 == null)
            {
                Alert.show("TSystemTrailer == null");
            }
            this._view.setLabel(_loc_3.icon1, _loc_3.icon2, "");
            this._view.callback = this.callEnd;
            this._view.x = 0;
            TweenMax.to(this._view, 0.1, {scaleX:1, scaleY:1, x:Global.stage.stageWidth / 2 - 260});
            return;
        }// end function

        override public function stop(param1:AutoGuideData = null) : void
        {
            super.stop(param1);
            if (param1 != null)
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.AutoGuideStepEnd, param1));
            }
            return;
        }// end function

        private function callEnd() : void
        {
            this.stop(_data);
            return;
        }// end function

    }
}
